package lab02.Test06;

public class Triangle {
    double length1;
    double length2;
    double length3;
    double high;
    boolean judge;

    double area() {
        high = ((double) (length1 + length2 + length3)) / 2;
        return (float) Math.sqrt(high * (high - length2) * (high - length3));
    }

    double perimeter() {
        return length1 + length2 + length3;
    }

    void isJudge() {
        if (length1 + length2 < length3 || length1 + length3 < length2 || length2 + length3 < length1) {
            System.out.println("不能构成三角形");
        } else System.out.println("可以构成三角形");
    }
}
